package com.wxyzz.canteenadmin.goods.message.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wxyzz.canteenadmin.goods.message.mapper.MessageMapper;
import com.wxyzz.canteenadmin.goods.message.param.MessageDataParam;
import com.wxyzz.canteenadmin.goods.message.service.MessageService;
import com.wxyzz.canteencommon.common.PageParam;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service
public class MessageServiceImpl implements MessageService {
    @Resource
    private MessageMapper messageMapper;
    @Override
    public PageInfo<MessageDataParam> findAllMessage(PageParam pageParam) {
        PageHelper.startPage(pageParam.getPageNum(), pageParam.getPageSize());
        List<MessageDataParam> messageDataParams = messageMapper.selectAllMessage();
        PageInfo<MessageDataParam> messageDataParamPageInfo = new PageInfo<>(messageDataParams);
        return messageDataParamPageInfo;
    }
}
